﻿
using ShineTech.Domain.SeedWork;
using System;

namespace ShineTech.Domain.Models.Users
{
    public class User : Entity, IAggregateRoot
    {
        public string Name { get; private set; }

        public string Password { get; set; }
        public string Email { get; private set; }
        public string Phone { get; private set; }

        protected User()
        {
        }
        public User(string name, string password, string email, string phone)
        {
            if (string.IsNullOrEmpty(name))
                throw CustomException.NullArgument(nameof(name));

            if (string.IsNullOrEmpty(password))
                throw CustomException.NullArgument(nameof(password));


            if (string.IsNullOrEmpty(email))
                throw CustomException.NullArgument(nameof(email));

            if (string.IsNullOrEmpty(phone))
                throw CustomException.NullArgument(nameof(phone));

            Name = name;
            Email = email;
            Phone = phone;
            Password = password;
        }

     
       

    }
}
